<?php
/**
 * 跨域处理,线上可配置代理转发,避免跨域
 * 2019.8.3
 */

namespace app\manage\behavior;

use think\Response;
class CORS {
    public function appInit(){
       header('Access-Control-Allow-Origin:*');
       header('Access-Control-Allow-Methods:*');
       header('Access-Control-Allow-Headers:*');
       header('Access-Control-Allow-Credentials:false');
        if(request()->isOptions()){
            exit();
        }
    }

}